﻿const fs=require("fs");
const childprocess=require("child_process");

for(var i=0;i<3;i++){
	var workerProcess=childprocess.exec('node support.js '+i,
		function(error,stdout,stderr){
			if(error){
				console.log(error.statk);
				console.log('Error code:'+error.code);
				console.log('Signal recerved:'+error.signal);
			}
			console.log('stdout:'+stdout);
			console.log('stderr:'+stderr);
	});
	
	workerProcess.on('exit',function(code){
		console.log('子程序已退出，退出码 '+code);
	})
}